import { t } from '@/locales/i18n';

import {
  FlowNodeInputTypeEnum,
  FlowNodeTemplateTypeEnum,
  FlowNodeTypeEnum,
  NodeInputKeyEnum,
  WorkflowIOValueTypeEnum,
} from '../../constant';
import { FlowNodeTemplateType } from '../../node';
import { getHandleConfig } from '../utils';

export const AssignedAnswerModule: FlowNodeTemplateType = {
  id: FlowNodeTypeEnum.answerNode,
  templateType: FlowNodeTemplateTypeEnum.tools,
  flowNodeType: FlowNodeTypeEnum.answerNode,
  sourceHandle: getHandleConfig(true, true, true, true),
  targetHandle: getHandleConfig(true, true, true, true),
  avatar: 'assignedAnswer.svg',
  name: t('assigned_reply'),
  intro: t('workflow.assigned_reply_desc'),
  courseUrl: '/docs/workflow/modules/reply/',
  version: '481',
  isTool: true,
  isFolded: true,
  inputs: [
    {
      key: NodeInputKeyEnum.answerText,
      renderTypeList: [FlowNodeInputTypeEnum.textarea, FlowNodeInputTypeEnum.reference],
      valueType: WorkflowIOValueTypeEnum.any,
      required: true,
      label: t('core.module.input.label.Response content'),
      description: t('core.module.input.description.Response content'),
      placeholder: t('core.module.input.description.Response content'),
    },
  ],
  outputs: [],
};
